package cn.dujc.superkid.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author kasumi
 * date 2018/7/29 下午9:10
 */
public class TeacherResult implements Parcelable {
    private String cname;
    private List<TeacherListEntity> list;//老师列表

    public String getCname() {
        return cname;
    }

    public void setCname(String cname) {
        this.cname = cname;
    }

    public List<TeacherListEntity> getList() {
        return list;
    }

    public void setList(List<TeacherListEntity> list) {
        this.list = list;
    }

    public static class TeacherListEntity implements Parcelable{
        /**
         * "id": 20,
         "user_nicename": "郑超",
         "thumb": "http:\/\/7xu137.com1.z0.glb.clouddn.com\/20170915_59bb930826e9a.png",
         "signature": "牛娃课程代数组，来自于上海交大的硕士研究生，本科阶段专业排名第一。对数学的痴迷让他不断在数学中思考，使他用自己的方式熟悉了数学这位好朋友。你也想结交数学这位好朋友吗？那就来让他给你介绍一下吧！"
         * */
        private String id;
        private String user_nicename;
        private String thumb;
        private String signature;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getUser_nicename() {
            return user_nicename;
        }

        public void setUser_nicename(String user_nicename) {
            this.user_nicename = user_nicename;
        }

        public String getThumb() {
            return thumb;
        }

        public void setThumb(String thumb) {
            this.thumb = thumb;
        }

        public String getSignature() {
            return signature;
        }

        public void setSignature(String signature) {
            this.signature = signature;
        }

        public static final Creator<TeacherListEntity> CREATOR = new Creator<TeacherListEntity>() {
            @Override
            public TeacherListEntity createFromParcel(Parcel source) {return new TeacherListEntity(source);}

            @Override
            public TeacherListEntity[] newArray(int size) {return new TeacherListEntity[size];}
        };

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.user_nicename);
            dest.writeString(this.thumb);
            dest.writeString(this.signature);
        }
        public TeacherListEntity() {}

        protected TeacherListEntity(Parcel in) {
            this.id = in.readString();
            this.user_nicename = in.readString();
            this.thumb = in.readString();
            this.signature = in.readString();
        }
    }

    public TeacherResult() {}

    protected TeacherResult(Parcel in) {
        this.cname = in.readString();
        this.list = in.createTypedArrayList(TeacherResult.TeacherListEntity.CREATOR);
    }

    public static final Creator<TeacherResult> CREATOR = new Creator<TeacherResult>() {
        @Override
        public TeacherResult createFromParcel(Parcel source) {return new TeacherResult(source);}

        @Override
        public TeacherResult[] newArray(int size) {return new TeacherResult[size];}
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.cname);
        dest.writeTypedList(this.list);
    }
}
